/**
 * 属性修饰符
 * 可选属性 ?:
 * */

type Shape_opt = {

}

interface PaintOptions {
  shape: Shape_opt,
  xPos?: number,
  yPos?: number
}

function paintShape(opts: PaintOptions) {
  let xPos = opts.xPos
  let yPos = opts.yPos
  console.log(xPos, yPos)
}

const shape: Shape_opt = {}
paintShape({ shape })
paintShape({ shape, xPos: 100 })
paintShape({ shape, yPos: 100 })
paintShape({ shape, xPos: 100, yPos: 100 })